package com.pipi.sso.dao.manager.impl;

import com.pipi.sso.dao.mapper.ext.RepairExtMapper;
import com.pipi.sso.dao.model.RepairDO;
import com.pipi.sso.dao.query.RepairQuery;
import com.pipi.sso.dao.support.PageResult;
import com.pipi.sso.dao.manager.RepairManager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for Repair.
 */

@Component
public class RepairManagerImpl implements RepairManager{

    
    @Autowired
    protected RepairExtMapper repairExtMapper;
    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(RepairQuery query){
        return repairExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(RepairQuery query){
        return repairExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(RepairDO record){
        return repairExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(RepairDO record){
        return repairExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<RepairDO> selectByQuery(RepairQuery query){
        return repairExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
    */
    @Override
    public PageResult<RepairDO> selectByQueryWithPage(RepairQuery query) {
        PageResult<RepairDO> result = new PageResult<RepairDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public RepairDO selectByPrimaryKey(Long id){
        return repairExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective( RepairDO record,  RepairQuery query){
        return repairExtMapper.updateByQuerySelective(record,  query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery( RepairDO record,  RepairQuery query){

        return repairExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(RepairDO record){
        return repairExtMapper.updateByPrimaryKeySelective(record);
    }
}